use rbatis::{crud, impl_select, impl_select_page};

#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct TraitIndex {
    pub id: Option<i32>,
    pub trait_info: Option<String>,
    pub class_name: Option<String>,
    pub scope: Option<String>,
    pub specific: Option<String>,
}
crud!(TraitIndex {});
impl_select!(TraitIndex{select_by_id(id:i32) => r#" where id = #{id} limit 1 "#});
impl_select_page!(TraitIndex{select_page(id:i32) => r#"where id between #{id} and 100000 "#});
impl_select!(TraitIndex{select_by_code(code:&str) => r#"
 where specific like #{code}
"#});
